<div id="warehousingTask">
    <!--页面调整-->
    <el-row v-loading="showLoading"
            element-loading-text="拼命加载中">
        <el-col :span="24">
            <div class="inner btn-nav">
                <el-input
                        @change="selectReturn"
                        v-model="rkrwNo"
                        icon="search"
                        placeholder="任务单号"></el-input>
                <el-input
                        @change="selectReturn"
                        v-model="rkrwSjxm"
                        icon="search"
                        placeholder="司机姓名"></el-input>
                <el-input
                        @change="selectReturn"
                        v-model="rkrwCph"
                        icon="search"
                        placeholder="车牌号"></el-input>
                <button @click="dialogSelectVisible=!dialogSelectVisible" class="btn btn-search"><i
                        class="icon search"></i><span>详细查询</span>
                </button>
                <button @click="multiSelectClick" class="btn btn-multiSelect"><i
                        class="icon sel"></i><span>多选</span>
                </button>
                <button @click="multiOperationIssued" class="btn btn-Issued" v-show="multiSelect"><i
                        class="icon issued"></i><span>下发</span>
                </button>
            </div>
            <el-table
                    :data="warehousingTask"
                    :max-height="config_table_height()"
                    ref="table"
                    @expand="expandChange"
                    @selection-change="multiSelectionChange"
                    class="warehousingTaskTable"
                    style="width: 100%">
                <el-table-column
                        type="expand">
                    <template scope="props">
                        <el-carousel
                                arrow="hover"
                                height="280px"
                                indicator-position="none"
                                :autoplay="false">
                            <el-carousel-item>
                                <el-row>
                                    <h3>入库任务详细<span
                                            style="font-size: 14px;
                                            font-weight: normal;
                                            margin-left: 5px;">(翻页查看任务单据）</span>
                                    </h3>
                                </el-row>
                                <el-form label-position="left" inline class="demo-table-expand">
                                    <el-row>
                                        <el-col :span="10">
                                            <el-form-item label="任务号">
                                                <el-tag type="success">
                                                    {{ props.row.rkrwNo }}
                                                </el-tag>
                                            </el-form-item>
                                            <el-form-item label="车牌号">
                                                <span>{{ props.row.rkrwCph }}</span>
                                            </el-form-item>
                                            <el-form-item label="订单数">
                                                <span>{{props.row.orders}}</span>
                                            </el-form-item>
                                            <el-form-item label="品项数">
                                                <span>{{props.row.goodsType}}</span>
                                            </el-form-item>
                                            <el-form-item label="司机姓名">
                                                <span>{{ props.row.rkrwSjxm }}</span>
                                            </el-form-item>
                                            <el-form-item label="调拨地">
                                                <el-tooltip class="item" effect="dark" :content="props.row.rkrwDbd"
                                                            placement="top">
                                                    <span>{{ props.row.rkrwDbd }}</span>
                                                </el-tooltip>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="10" :offset="2">
                                            <el-form-item label="预计到货">
                                                <span>{{auto_time_new(props.row.rkrwDhrq,6) }}</span>
                                            </el-form-item>
                                            <el-form-item label="承运商">
                                                <span>{{ props.row.rkrwCys }}</span>
                                            </el-form-item>
                                            <el-form-item label="司机电话">
                                                <span>{{ props.row.rkrwDh }}</span>
                                            </el-form-item>
                                            <el-form-item label="任务状态">
                                                <el-tag-s
                                                        :val="auto_el_tag('rkRwStatus',props.row.rkrwStatus)"></el-tag-s>
                                            </el-form-item>
                                            <el-form-item
                                                    label="可用操作">
                                                <el-button
                                                        size="small"
                                                        icon="edit"
                                                        @click="inlineEdit(props.$index, props.row)">
                                                </el-button>
                                                <el-button
                                                        size="small"
                                                        type="success"
                                                        v-if="props.row.rkrwStatus==1"
                                                        @click="inlineIssued(props.$index, props.row)">下发
                                                </el-button>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-form>
                            </el-carousel-item>
                            <el-carousel-item>
                                <el-row>
                                    <h3>入库任务单据<span
                                            style="font-size: 14px;
                                            font-weight: normal;
                                            margin-left: 5px;">（双击查看单据明细）</span>
                                    </h3>
                                </el-row>
                                <el-table
                                        :data="props.row.docList"
                                        @row-dblclick="dblClick"
                                        :max-height="240">
                                    <el-table-column
                                            width="80"
                                            align="center"
                                            show-overflow-tooltip
                                            label="仓库">
                                        <template scope="scope">
                                            {{auto_jc(scope.row.jc)}}
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                            label="入库单号"
                                            width="170"
                                            show-overflow-tooltip
                                            align="center"
                                            prop="rkRkdjNo">
                                    </el-table-column>
                                    <el-table-column
                                            width="160"
                                            align="center"
                                            label="收货时间">
                                        <template scope="scope">
                                            <span>{{ auto_time_new(scope.row.rkKsshsj,4) }}</span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                            label="类型"
                                            show-overflow-tooltip
                                            align="center"
                                            width="80">
                                        <template scope="scope">
                                            {{ auto_rkType(scope.row.rkType) }}
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                            label="状态"
                                            align="center"
                                            width="100">
                                        <template scope="scope">
                                            <el-tag-s :val="auto_el_tag('rkStatus',scope.row.rkStatus)"></el-tag-s>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                            label="总台数"
                                            align="center"
                                            show-overflow-tooltip
                                            prop="allCount">
                                    </el-table-column>
                                    <el-table-column
                                            label="总体积"
                                            align="center"
                                            show-overflow-tooltip
                                            prop="allTj">
                                    </el-table-column>
                                    <el-table-column
                                            label="总件数"
                                            show-overflow-tooltip
                                            prop="jianAndtaiAllCount">
                                    </el-table-column>
                                </el-table>
                            </el-carousel-item>
                        </el-carousel>
                    </template>
                </el-table-column>
                <el-table-column
                        label="任务号"
                        show-overflow-tooltip
                        prop="rkrwNo"
                        align="center">
                </el-table-column>
                <el-table-column
                        label="车牌号"
                        show-overflow-tooltip
                        align="center"
                        prop="rkrwCph">
                </el-table-column>
                <el-table-column
                        label="订单数"
                        show-overflow-tooltip
                        align="center"
                        prop="orders">
                </el-table-column>
                <el-table-column
                        label="品项数"
                        show-overflow-tooltip
                        align="center"
                        prop="goodsType">
                </el-table-column>
                <el-table-column
                        label="司机姓名"
                        show-overflow-tooltip
                        align="center"
                        prop="rkrwSjxm">
                </el-table-column>
                <el-table-column
                        label="任务状态"
                        prop="status"
                        align="center"
                        width="130">
                    <template scope="scope">
                        <el-tag-s :val="auto_el_tag('rkRwStatus',scope.row.rkrwStatus)"></el-tag-s>
                    </template>
                </el-table-column>
                <el-table-column
                        v-if="multiSelect"
                        type="selection"
                        width="60">
                </el-table-column>
            </el-table>
            <div class="block">
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="1"
                        :page-sizes="[5, 10, 15, 20, 100, 500, 1000, 5000, 10000]"
                        :page-size="pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="currentTotal">
                </el-pagination>
            </div>
        </el-col>
    </el-row>
    <el-dialog
            size="tiny"
            class="select"
            v-model="dialogSelectVisible">
        <div class="dialog-title clearfix" slot="title">
            <span class="el-dialog__title">详细查询</span>
        </div>
        <el-form :model="form">
            <el-form-item label="车牌号"
                          :label-width="formLabelWidth">
                <el-input
                        class="input"
                        v-model="form.rkrwCph"
                        icon="search"
                        placeholder="车牌号"></el-input>
            </el-form-item>
            <el-form-item label="司机姓名"
                          :label-width="formLabelWidth">
                <el-input
                        class="input"
                        v-model="form.rkrwSjxm"
                        icon="search"
                        placeholder="司机姓名"></el-input>
            </el-form-item>
            <el-form-item label="预计到货日期"
                          :label-width="formLabelWidth">
                <el-date-picker
                        v-model="form.rkrwDhrq"
                        type="datetime"
                        align="right"
                        placeholder="到货日期"
                        class="input">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="调拨地"
                          :label-width="formLabelWidth">
                <el-input
                        class="input"
                        v-model="form.rkrwDbd"
                        icon="search"
                        placeholder="调拨地"></el-input>
            </el-form-item>
            <el-form-item label="承运商"
                          :label-width="formLabelWidth">
                <el-input
                        class="input"
                        v-model="form.rkrwCys"
                        icon="search"
                        placeholder="承运商"></el-input>
            </el-form-item>
            <el-form-item label="任务号"
                          :label-width="formLabelWidth">
                <el-input
                        v-model="form.rkrwNo"
                        class="input"
                        icon="search"
                        placeholder="任务号"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="form = _form()">重置</el-button>
            <el-button type="primary" @click="selectSubmit" :loading="selectLoading">查询</el-button>
        </div>
    </el-dialog>
    <el-dialog
            size="large"
            v-model="dialogListsVisible">
        <div class="dialog-title clearfix" slot="title">
            <span class="el-dialog__title">入库明细 单号：{{lists.rkRkdjNo}}</span>
        </div>
        <el-table
                :data="lists.data"
                highlight-current-row
                style="width: 100%">
            <el-table-column
                    type="index"
                    width="55">
            </el-table-column>
            <el-table-column
                    label="货品编号"
                    width="140"
                    show-overflow-tooltip
                    align="center"
                    prop="baseGoods.bgGoodsNo">
            </el-table-column>
            <el-table-column
                    align="center"
                    prop="baseGoods.bgGoodsName"
                    show-overflow-tooltip
                    label="货品名称">
            </el-table-column>
            <el-table-column
                    align="center"
                    prop="rksStatus"
                    show-overflow-tooltip
                    label="单据状态">
                <template scope="scope">
                    <el-tag-s :val="auto_el_tag('rksStatus',scope.row.rksStatus)"></el-tag-s>
                </template>
            </el-table-column>
            <
            el-table-column
            label="单位"
            width="80"
            prop="baseDw.bdName"
            align="center">
            </el-table-column>
            <el-table-column
                    label="数量"
                    width="100"
                    show-overflow-tooltip
                    prop="rksCount"
                    align="center">
            </el-table-column>
            <el-table-column
                    align="center"
                    prop="rksQhsl"
                    show-overflow-tooltip
                    label="欠货数量">
            </el-table-column>
            <el-table-column
                    align="center"
                    prop="rksBfdh"
                    show-overflow-tooltip
                    label="补发单号">
            </el-table-column>
            <el-table-column
                    align="center"
                    prop="rksWjReason"
                    show-overflow-tooltip
                    label="完结原因">
            </el-table-column>

        </el-table>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="dialogListsVisible=false">关闭</el-button>
        </div>
    </el-dialog>
    <el-dialog
            size="large"
            v-model="dialogFormVisible">
        <div class="dialog-title clearfix" slot="title">
            <span class="el-dialog__title">{{form.title}}</span>
            <el-steps
                    class="steps"
                    :space="200"
                    :active="dialogFormActive"
                    finish-status="success">
                <el-step title="任务详细"></el-step>
                <el-step title="入库单据"></el-step>
            </el-steps>
        </div>
        <el-carousel
                ref="carousel"
                :autoplay="false"
                arrow="never"
                indicator-position="none"
                height="55vh">
            <el-carousel-item>
                <el-form :model="form" ref="ref_form" :rules="rule_form">
                    <el-row>
                        <el-col :span="10">
                            <el-form-item
                                    label="任务号"
                                    :label-width="formLabelWidth">
                                <el-tag type="success">{{form.rkrwNo}}</el-tag>
                            </el-form-item>
                            <el-form-item
                                    label="车牌号"
                                    prop="rkrwCph"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model="form.rkrwCph"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="订单数"
                                    :label-width="formLabelWidth">
                                <span>{{form.orders}}</span>
                            </el-form-item>
                            <el-form-item
                                    label="品项数"
                                    :label-width="formLabelWidth">
                                <span>{{form.goodsType}}</span>
                            </el-form-item>

                            <el-form-item
                                    label="调拨地"
                                    prop="rkrwDbd"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model="form.rkrwDbd"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10" :offset="2">
                            <el-form-item
                                    label="到货日期"
                                    prop="rkrwDhrq"
                                    :label-width="formLabelWidth">
                                <el-date-picker
                                        v-model="form.rkrwDhrq"
                                        type="datetime"></el-date-picker>
                            </el-form-item>
                            <el-form-item
                                    label="承运商"
                                    prop="rkrwCys"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model="form.rkrwCys"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="司机姓名"
                                    prop="rkrwSjxm"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model="form.rkrwSjxm"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="司机电话"
                                    prop="rkrwDh"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model="form.rkrwDh"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="任务状态"
                                    :label-width="formLabelWidth">
                                <el-tag-s :val="auto_el_tag('rkRwStatus',form.rkrwStatus)"></el-tag-s>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
            </el-carousel-item>


            <el-carousel-item>
                <el-row>
                    <el-col :span="24">
                        <div class="inner btn-nav btn-nav2">
                            <el-input
                                    v-model="form.list2.rkRkdjNo"
                                    icon="search"
                                    placeholder="入库单号"></el-input>
                            <el-date-picker
                                    v-model="form.list2.date"
                                    type="daterange"
                                    align="right"
                                    placeholder="选择日期"
                                    class="datePicker"
                                    :picker-options="pickerOptions">
                            </el-date-picker>
                            </button>
                            <button @click="list2_more"
                                    class="btn btn-multiSelect"><i
                                    class="icon sel"></i><span>多选</span>
                            </button>
                            <button @click="list2_moreOperationDelete" class="btn btn-del"
                                    v-show="form.list2.multiSelect"><i
                                    class="icon del"></i><span>批量删除</span>
                            </button>
                        </div>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <h3>等待选择</h3>
                        <el-table
                                :data="form.list2.warehousingReservation"
                                :max-height="350"
                                class="list2_table"
                                @select="list2_handleSelectionChange"
                                @select-all="list2_handleSelectionChangeAll">
                            <el-table-column
                                    type="expand">
                                <template scope="props">
                                    <el-row>
                                        <el-col :span="24">
                                            <el-form label-position="left" inline class="demo-table-expand">
                                                <el-form-item label="入库单号">
                                                    <span>{{ props.row.rkRkdjNo }}</span>
                                                </el-form-item>
                                                <el-form-item label="下单时间">
                                                    <el-icon name="time"></el-icon>
                                                    <span style="margin-left: 10px">{{ auto_rkCreatetime(props.row.rkCreatetime) }}</span>
                                                </el-form-item>
                                                <el-form-item label="订单类型">
                                                    <span>{{ auto_rkType(props.row.rkType) }}</span>
                                                </el-form-item>
                                                <el-form-item label="入库状态">
                                                    <span>{{ auto_rkStatus(props.row.rkStatus) }}</span>
                                                </el-form-item>
                                                <el-form-item label="入库数量">
                                                    <span>{{ props.row.allCount }}</span>
                                                </el-form-item>
                                                <el-form-item label="入库体积">
                                                    <span>{{ props.row.allTj    }}</span>
                                                </el-form-item>
                                                <el-form-item label="制作方式">
                                                    <span>{{ auto_rkZdfs(props.row.rkZdfs) }}</span>
                                                </el-form-item>
                                                <el-form-item label="入库备注">
                                                    <el-tooltip class="item" effect="dark"
                                                                :content="props.row.rkRemarks"
                                                                placement="top">
                                                        <span class="remark">{{ props.row.rkRemarks }}</span>
                                                    </el-tooltip>
                                                </el-form-item>
                                            </el-form>
                                        </el-col>
                                    </el-row>
                                </template>
                            </el-table-column>
                            <el-table-column
                                    label="所属仓库"
                                    align="center"
                                    prop="rkArehouseId">
                                <template scope="scope">
                                    <el-tag
                                            type="success"
                                            close-transition>
                                        {{auto_rkArehouseId(scope.row.rkArehouseId)}}
                                    </el-tag>
                                </template>
                            </el-table-column>
                            <el-table-column
                                    label="入库单号"
                                    show-overflow-tooltip
                                    align="center"
                                    prop="rkRkdjNo">
                            </el-table-column>
                            <el-table-column
                                    width="80"
                                    align="center"
                                    label="时间">
                                <template scope="scope">
                                    {{auto_rkCreatetime(scope.row.rkCreatetime,true)}}
                                </template>
                            </el-table-column>
                            <el-table-column
                                    type="selection"
                                    width="60">
                            </el-table-column>
                        </el-table>
                    </el-col>
                    <el-col :span="12">
                        <h3>等待组合</h3>
                        <el-table
                                :data="form.list2.warehousingReservationCombination"
                                :max-height="350"
                                class="list2_table"
                                @selection-change="list2_handleSelectionChangeCombination">
                            <el-table-column
                                    type="index"
                                    width="55">
                            </el-table-column>
                            <el-table-column
                                    label="所属仓库"
                                    align="center"
                                    prop="rkArehouseId">
                                <template scope="scope">
                                    <el-tag
                                            type="success"
                                            close-transition>
                                        {{auto_rkArehouseId(scope.row.rkArehouseId)}}
                                    </el-tag>
                                </template>
                            </el-table-column>
                            <el-table-column
                                    label="入库单号"
                                    show-overflow-tooltip
                                    align="center"
                                    prop="rkRkdjNo">
                            </el-table-column>

                            <el-table-column
                                    width="80"
                                    align="center"
                                    label="时间">
                                <template scope="scope">
                                    {{auto_rkCreatetime(scope.row.rkCreatetime,true)}}
                                </template>
                            </el-table-column>
                            <el-table-column
                                    v-if="form.list2.multiSelect"
                                    type="selection"
                                    width="60">
                            </el-table-column>
                        </el-table>
                    </el-col>
                </el-row>
            </el-carousel-item>
        </el-carousel>

        <div slot="footer" class="dialog-footer">
            <el-button class='formBottom' type="primary" @click="prev" v-show="dialogFormActive&&form.rkrwStatus==1">
                上一步
            </el-button>
            <el-button class='formBottom' type="primary" @click="next" v-show="dialogFormActive<1&&form.rkrwStatus==1">
                下一步
            </el-button>
            <el-button class='formBottom' type="primary" @click="submit" :loading="submitLoading"
                       :disabled="form.list2.warehousingReservationCombination.length==0&&form.rkrwStatus==1"
                       v-show="dialogFormActive>=1||form.rkrwStatus>=2">保存
            </el-button>
        </div>
    </el-dialog>
</div>
<link rel="stylesheet" href="index.scss">
<script src="index.js"></script>
